package template

import (
	"fmt"
)

type Caffeine interface {
	brew()
	addCondiments()
}

///////////////////////////////////////////////
type Tea struct {
}

func (t *Tea) brew() {
	fmt.Println("tea brew!")
}

func (t *Tea) addCondiments() {
	fmt.Println("tea addCondiments!")
}

//////////////////////////////////////////////
type Coffee struct {
}

func (t *Coffee) brew() {
	fmt.Println("coffee brew!")
}

func (t *Coffee) addCondiments() {
	fmt.Println("coffee addCondiments!")
}

//////////////////////////////////////////////
type CaffeineBeverage struct {
	Caffeine
}

func NewCaffeineBeverage(c Caffeine) *CaffeineBeverage {
	t := new(CaffeineBeverage)
	t.Caffeine = c
	return t
}

func (t *CaffeineBeverage) PrepareRecipe() {
	t.boilWater()
	t.brew()
	t.pourInCup()
	t.addCondiments()
}

func (t *CaffeineBeverage) boilWater() {
	fmt.Println("boilWater!")
}

func (t *CaffeineBeverage) pourInCup() {
	fmt.Println("pourInCup!")
}
